#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QGraphicsItem>
#include <QToolButton>
#include <QMouseEvent>
#include <QPaintEvent>

#include "dwgobject.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE



class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    DrawType curDrawType=None;
    QPainter * mpainter = nullptr;


private slots:
    void on_actionNew_triggered();

    void on_actionOpen_triggered();

    void on_actionSave_triggered();

    void on_actionSaveAs_triggered();

    void on_actionExit_triggered();

    void pointTB_clicked();

    void lineTB_clicked();

    void circleTB_clicked();

    void rectangleTB_clicked();

    void arcTB_clicked();

    void pLineTB_clicked();

    void splineTB_clicked();

private:
    Ui::MainWindow *ui;
    QList<DwgObject*> m_MainList;  // 假设存储的是某种数据类型
    // QWidget interface
protected:
    virtual void mousePressEvent(QMouseEvent *event);
    virtual void paintEvent(QPaintEvent *event);
};

#endif // MAINWINDOW_H
